var JSMock = function JSMock()
{
	var mockedObjects = {};
	this.mockObject = function JSMock$MockObject(name, returnType)
	{
		return this._createObject(name);
	};
	
	this._createObject = function JSMock$_createObject(objectName)
	{
		var mock = this;
		return mockedObjects[objectName] = {
			"target":{}, 
			"expectAndReturn": function expectAndReturn(funcName, comparerValue, objBody)
				{
					var me = this;
					var obj;
					if (this.target[funcName] == null)
					{
						obj = {
							"comparers" : {},
							"func": function func()
								{
									return this.comparers[mock._serialize(arguments)];
								}
						};
					}
					else
					{
						obj = this.target[funcName].object;
					}
					obj.comparers[mock._serialize(comparerValue)] = objBody;
					var returns = function(){
						return obj.func.apply(obj, arguments);
					};						
					this.target[funcName] = returns;
					this.target[funcName].object = obj;
				}
		};
	};

	this._serialize = function JSMock$_serialize(arrayValue)
	{
		var serial = "";
		for (i=0;i<arrayValue.length;i++)
		{
			serial+= new String(arrayValue[i]);
		}
		return serial;
	};
}